<template>
  <div class="header_ref">
    <div class="tabs_box">
      <ul>
        <li class="active">教学计划</li>
      </ul>
    </div>
    <div class="search">
      <el-input clearable placeholder="按计划名称搜索" prefix-icon="el-icon-search" v-model="value" @keydown.enter="$emit('search', value)" @clear="value = null" />
    </div>
    <div class="btns" v-permissions="'add'">
      <el-button round @click="$emit('add-plan')">新建计划</el-button>
    </div>
  </div>
</template>
<script>
import { ref } from 'vue';
export default {
  setup() {
    const value = ref(null);

    return { value }
  }
}
</script>
<style lang="scss" scoped>
.header_ref {
  display: flex;
  line-height: 60px;
  .tabs_box {
    li {
      float: left;
      padding: 0 20px;
      color: #fff;
      list-style: none;
      position: relative;
      cursor: pointer;
      &.active::after {
        content: '';
        display: block;
        width: 100%;
        height: 6px;
        background: #FAAD14;
        border-radius: 3px;
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
      }
    }
  }
  .search {
    margin-left: auto;
    :deep(.el-input__prefix),
    :deep(.el-input__suffix) {
      color: #fff !important;
    }
    :deep(input) {
      width: 240px;
      height: 36px;
      color: #fff;
      border: 0;
      border-radius: 18px;
      background: rgba(255, 255, 255, 0.3);
      &::placeholder {
        color: rgba(255, 255, 255, .7);
      }
    }
  }
  .btns {
    button {
      color: #72b22a;
      padding: 10px 20px;
      margin-left: 18px;
    }
  }
}
</style>
